-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added check for conv implementation #1155
base: main
Are you sure you want to change the base?
added check for conv implementation #1155
Conversation
I will just add that the reason for this change was because in some cases the instructions became huge and made compilation more difficult, even though they were then unused. |
It does seem to cause some test failures that should be investigated. |
@@ -18,7 +18,7 @@ def transform(self, model, node): | |||
raise Exception(f'Cannot generate instructions for node {node.name} ({node_class})') | |||
|
|||
def _generate_1d_instructions(self, node): | |||
if node.model.config.get_config_value('IOType') == 'io_stream': | |||
if node.model.config.get_config_value('IOType') == 'io_stream' and node.get_attr('conv_implementation') == 'Encoded': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One should maybe make this check case-insensitive.
Would it make sense to add this check in the match() method rather than the transform() method? That way the optimizer will never even be executed.
Also, since this only applies to encoded implementation, should we rename this optimizer to reflect that?
|
I think "Instructions" implies encoded to me, but maybe not to everyone. But I do like the idea of moving this to the match. There may need to be some changes in the parameter creation (in |
We would still need to run the optimizer to add dummy weights in the case of LineBuffer implementations but we can skip generating instructions with the added condition in the if statement. |
I think the suggestion from @bo3z is the better approach. Can we change it so that the check is on the match? There may be some downstream minor fixes needed with that approach, though, mainly allowing for undefined instructions and min widths/heights. |
I've updated the optimizer match() to check the IOType and implementation. The LineBuffer default values are now added to Conv2DConfigTemplate and Conv1DConfigTemplate. |
Description
This change adds a check in the Vivado backend to skip instruction calculations for CONV1D and CONV2D when using linebuffer implementations. Since linebuffers do not require calculating instructions, min_height, or min_width, performing these calculations is redundant.
Note: Please delete options that are not relevant.
Tests
Should not break current tests
Checklist
pre-commit
on the files I edited or added.